<?php
if(!function_exists('the_permalink'))
{
    function the_permalink($id,$type = 'tintuc')
    {
        $ci = &get_instance();
        $ci->db->where('a_id',$id);
        $query = $ci->db->get('alias');
        $data = $query->result();
        $query->free_result();
        if(!empty($data))
        {
            echo site_url($data[0]->alias);
        }
        else
        {
            echo '';
        }
    }
}